package com.monitor.app_monitor.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultInfo<T> {

    private String status; //error ok

    private String description;

    private T data;


    public static ResultInfo ok(Object data) {
        return new ResultInfo<>("ok".intern(), "", data);
    }

    public static ResultInfo ok(String desc) {
        return new ResultInfo<>("ok".intern(), desc, null);
    }

    public static ResultInfo ok(Object data, String desc) {
        return new ResultInfo<>("ok".intern(), desc, data);
    }

    public static ResultInfo error(String desc) {
        return new ResultInfo<>("error".intern(), desc, null);
    }
}
